In this post we’ll setup a UniFi Controller on Docker and get logged in and adopt an access point.
I’ll assume you’ve already got a working docker installation (in my case I’m running docker on a Raspberry Pi 4 (8GB) and also using Docker Compose, as I find that makes it easy to manage containers.
Docker Container Setup
SSH to your docker host and change directory to where you store your containers. in my case I store the containers on a mounted NAS so its /mnt/DanNAS/
cd /mnt/DanNAS/
Create a new directory for the UniFi Controller container, move into the directory and create a directory for the config/log files
mkdir unifi-controller
cd unifi-controller
mkdir unifi
Create a docker-compose file using your favourite linux text editor (nano in my case)
nano docker-compose.yaml
Add the following to the file:
version: '3.8'
services:
unifi:
container_name: unifi-controller
image: "jacobalberty/unifi"
volumes:
- ./unifi:/unifi
restart: unless-stopped
network_mode: host
environment:
- TZ='Europe/London'
Save the file and you should be ready to bring up the controller
docker compose up -d
Docker should pull down the image and start the container, this may take a few minutes. Once you see the container has started you will still need to wait a couple mins for it to fully start the UniFi Application.
UniFi Controller Setup
If you browse to the IP of your docker machine (192.168.100.1 in my case) and port 8443, you should get the UniFi Controller setup page.
https://192.168.100.1:8443/
If you get the below error, you just need to wait a few more minutes as the controller is still booting up.
Once loaded properly it should look like this:
Give the Conroller a name, select your Country/Region and agree to the license agreement/terms and click Next.
Sign into your UI account, or if you just want to setup the controller with a local only account click advanced setup then in the box that appears click ‘skip’. You can then create a local only account.
In my case I’m going to login with my UI account so that it appears with my other Controller.
Once logged in (either locally or with a UI account) you’ll be presented with the main dashboard page, with not a lot to show since there are no devices adopted.
Before Adopting Change Inform IP
One thing I’ve found is that since this is running within a container on a host, the Controller will have its own IP address from docker, for adoption to work properly you need to override this IP with the IP of the docker host.
Got to the Settings wheel > System > Advanced
Enable the Inform Host Override then enter the IP Address of the docker host (the same IP you used to load the console. Click Save.
Adopt Devices
Connect the Access Point to the network and power up click on the devices page and you should see the AP available for adoption. In my case the device needed a reset as it had a message saying read more and that it needed a reset.
After a reset the device showed correctly ready to adopt
Click on Adopt and wait a few minutes for that to complete
Congratulations your new UniFi Controller is up and running with an Access Point adopted. Now to configure your WiFi networks and have fun!